package com.zzyl.mapper;

import com.zzyl.dto.NursingPlanDto;
import com.zzyl.entity.NursingPlan;
import com.zzyl.vo.NursingPlanVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import java.util.List;

/**
 * @author 31043
 */
@Mapper
public interface NursingPlanMapper {


    /**
     * @deprecated 分页条件查询
     * @param planName 护理计划名称
     * @param status 护理计划状态
     */
    List<NursingPlan> searchNursingPlans(@Param("planName") String planName, @Param("status") Integer status);

    /**
     * @deprecated 查询所有护理计划(启用)
     */
    List<NursingPlanVo> queryAllStatus();

    /**
     * @deprecated 根据护理计划名称和状态查询
     * @param planName 护理计划名称
     * @param status 护理计划状态
     */
    List<NursingPlanVo> queryNursingPlans(String planName, Integer status);

    /**
     * @deprecated 根据id查询护理计划
     * @param id 护理计划id
     */
    NursingPlan getNursingPlanById(Long id);

    /**
     * 新增计划
     * @param nursingPlan 计划数据
     */
    @Insert("INSERT INTO nursing_plan (sort_no, plan_name, status, create_time, update_time, create_by, update_by, remark) " +
            "VALUES (#{sortNo}, #{planName}, #{status}, #{createTime}, #{updateTime}, #{createBy}, #{updateBy}, #{remark})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    void insert(NursingPlan nursingPlan);


    /**
     * 更新计划
     * @param nursingPlan 更新后的数据
     */
    void update(NursingPlan nursingPlan);


    void deleteById(Long id);

    void updateStatus(Long id, Long status);
}